//
//  RankDetailViewController.m
//  CookDemo
//
//  Created by lanou3g on 15/9/4.
//  Copyright (c) 2015年 DTR. All rights reserved.
//

#import "RankDetailViewController.h"
#import "XiangHaLifeInfo.h"
#import "KitchenManager.h"
#import "RankCollectionViewCell.h"
#import "RankingKitchenInfo.h"
#import "XiangHaLifeInfo.h"
#import "UIImageView+WebCache.h"
#import "AFHTTPRequestOperationManager.h"
#import "RankDatilTableViewCell.h"
@interface RankDetailViewController ()
@property (nonatomic, strong)UIImageView *imageView;

//@property (nonatomic, strong)UITableView * table;
@property (weak, nonatomic) IBOutlet UIView *viewAll;
@end

@implementation RankDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    /*
    //NSLog(@"====%@",_i);
    // Do any additional setup after loading the view.
//    self.view.backgroundColor = [UIColor whiteColor];
    
    [[KitchenManager defaultManager] GetKitchenInfoComplete:^{
//        ===================
    }];
//    NSLog(@"%ld",[KitchenManager defaultManager].kitchenList.count);
    
//    self.TittleLabel.text =_i;
//    self.TextLabels.text = _j;
//    [self.imageDetail sd_setImageWithURL:[NSURL URLWithString:_k]];
    */
    
    /** 一下代码页面 */
    /*
    UILabel *label =[[UILabel alloc]initWithFrame:CGRectMake(10, 50, [UIScreen mainScreen].bounds.size.width-20, 60)];
    [label setText:_i];
//    [label setBackgroundColor:[UIColor redColor]];
    [label setLineBreakMode:(NSLineBreakByWordWrapping)];
    [label setNumberOfLines:0];
    [self.view addSubview:label];
    
    UILabel *labelf =[[UILabel alloc]initWithFrame:CGRectMake(10, 100, [UIScreen mainScreen].bounds.size.width-20, 60)];
    [labelf setText:_j];
    [labelf setLineBreakMode:(NSLineBreakByWordWrapping)];
    [labelf setNumberOfLines:0];
    [self.view addSubview:labelf];
    
    self.imageView =[[UIImageView alloc]initWithFrame:CGRectMake(25, 180, [UIScreen mainScreen].bounds.size.width-50, 250)];
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:_k]];
//    [self.view addSubview:_imageView];
    
    self.table =[[UITableView alloc]initWithFrame:CGRectMake(0, 200,[UIScreen mainScreen].bounds.size.width , 250)];
    
    [self.view addSubview:self.table];
    */
    /** 去除tableview 右侧滚动条 */
    _tableView.showsVerticalScrollIndicator = NO;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewWillAppear:(BOOL)animated{
    
    _TittleLabel.text=_i;
    [_TittleLabel setLineBreakMode:(NSLineBreakByWordWrapping)];
    [_TittleLabel setNumberOfLines:0];
    
    _TextLabels.text = _j;
    [_TextLabels setLineBreakMode:(NSLineBreakByWordWrapping)];
    [_TextLabels setNumberOfLines:0];
    /*
    
//    [_imageDetail sd_setImageWithURL: [NSURL URLWithString:_k]];
    
    [super viewWillAppear:animated];
//    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
//    [manager.responseSerializer setAcceptableContentTypes:[NSSet setWithObject:<#(id)#>] ]
//    [manager GET:@"http://project.lanou3g.com/teacher/yihuiyun/lanouproject/activitylist.php" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
//        
//        NSLog(@"Success:%@",responseObject);

    
  */
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    
    return _k.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
//    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RankDetailCell" forIndexPath:indexPath];
    RankDatilTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RankDCell" forIndexPath:indexPath];
    
    [cell.cellimage sd_setImageWithURL: [NSURL URLWithString:_k[indexPath.row]]];


/*
//    XiangHaLifeInfo *model = [KitchenManager defaultManager].XHLifeList[indexPath.row];
//    
    
    
//    [cell setCellWithXiangHaLifeInfo:model];
    
  */
    return cell;
}

/*
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    RankDetailViewController *rvc=[[RankDetailViewController alloc]init];
    
//    XiangHaLifeInfo *modelXiangHai = [KitchenManager defaultManager].XHLifeList[indexPath.row];
//    NSLog(@"-------------");
//    
// 
//    self.TittleLabel.text = modelXiangHai.title;
//    self.TextLabels.text = modelXiangHai.content;
//        [self.imageDetail sd_setImageWithURL:[NSURL URLWithString:modelXiangHai.imgs[0]]];
//    
////    NSLog(@"%@",rvc);
//    
//    [self showViewController:rvc sender:nil];
}

*/
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
